﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;

namespace GIVisualEditor
{
    public partial class frmHelpContent : Form
    {
        private string sFolderPath = "";

        public frmHelpContent()
        {
            InitializeComponent();
            this.Load += new EventHandler(frmHelpContent_Load);
        }

        void frmHelpContent_Load(object sender, EventArgs e)
        {
            sFolderPath = Assembly.GetAssembly(typeof(frmHelpContent)).Location;
            sFolderPath = sFolderPath.Substring(0, sFolderPath.LastIndexOf(@"\") + 1);
            
            treeView1.NodeMouseClick += new TreeNodeMouseClickEventHandler(treeView1_NodeMouseClick);
        }

        void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (treeView1.SelectedNode != null)
            {
                string sUrl = string.Format(treeView1.SelectedNode.Tag.ToString(), sFolderPath);
                webBrowser1.Navigate(sUrl);

            }
        }
    }
}
